<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->

<title>def_prog_mode</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<xref type="10" name="defshell"></xref>
<h4><a name = "tag_000_000">&nbsp;</a>NAME</h4><blockquote>
def_prog_mode, def_shell_mode, reset_prog_mode, reset_shell_mode
- save/restore program or shell terminal modes
</blockquote><h4><a name = "tag_001_009_776">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="curses.h.html">curses.h</a>&gt;

int def_prog_mode(void);

int def_shell_mode(void);

int reset_prog_mode(void);

int reset_shell_mode(void);
</code>
</pre>
</blockquote><h4><a name = "tag_001_009_777">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>def_prog_mode()</i>
function saves the current terminal modes as the &quot;program&quot; (in Curses)
state for use by
<i><a href="reset_prog_mode.html">reset_prog_mode()</a></i>.
<p>
The
<i>def_shell_mode()</i>
function saves the current terminal modes as the &quot;shell&quot; (not in Curses)
state for use by
<i>reset_shell_mode()</i>.
<p>
The
<i><a href="reset_prog_mode.html">reset_prog_mode()</a></i>
function restores the terminal to the &quot;program&quot; (in Curses) state.
<p>
The
<i>reset_shell_mode()</i>
function restores the terminal to the &quot;shell&quot; (not in Curses) state.
<p>
These functions affect the mode of the terminal associated with the current
screen.
</blockquote><h4><a name = "tag_001_009_778">&nbsp;</a>RETURN VALUE</h4><blockquote>
Upon successful completion, these functions return OK.  Otherwise, they return
ERR.
</blockquote><h4><a name = "tag_001_009_779">&nbsp;</a>ERRORS</h4><blockquote>
No errors are defined.
</blockquote><h4><a name = "tag_001_009_780">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
The
<i><a href="initscr.html">initscr()</a></i>
function achieves the effect of calling
<i>def_shell_mode()</i>
to save the prior terminal settings so they can be restored during the call to
<i><a href="endwin.html">endwin()</a></i>,
and of calling
<i>def_prog_mode()</i>
to specify an initial definition of the program terminal mode.
<p>
Applications normally do not need to refer to the shell terminal mode.
Applications may find it useful to save and restore the program terminal mode.
</blockquote><h4><a name = "tag_001_009_781">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="doupdate.html">doupdate()</a></i>,
<i><a href="endwin.html">endwin()</a></i>,
<i><a href="initscr.html">initscr()</a></i>,
<i><a href="curses.h.html">&lt;curses.h&gt;</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
